<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>添加或编辑界面</title>
    <link rel="stylesheet" type="text/css" href="${s.base}/lib/layui/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/index.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/theme/theme.css"/>
    <style>
        .w440{
            width: 440px !important;
        }
    </style>
</head>
<body>
<div class="page-content-wrap clearfix">
    <form class="layui-form" id="tool">
        <div class="layui-tab">
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;名称：</label>
                        <div class="layui-input-inline ">
                            <input type="text" name="name" value="${websiteConfiguration.name}" lay-verify="required" placeholder="请输入名称" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;手机号：</label>
                        <div class="layui-input-inline ">
                            <input type="text" name="phone" value="${websiteConfiguration.phone}" lay-verify="required" placeholder="请输入名称" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;座机号：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="telephone" value="${websiteConfiguration.telephone}" lay-verify="required" placeholder="请输入手机号" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;QQ：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="qqCode" value="${websiteConfiguration.qqCode}" lay-verify="required" placeholder="请输入QQ" autocomplete="off" class="layui-input" maxlength="200">
                        </div>

                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;logo：</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-block cy-uploadpic-ctn" id="logo" style=" float:left;margin-left:0!important;position:relative;"></div>
                        </div>
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;互动二维码：</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-block cy-uploadpic-ctn" id="interactQr" style=" float:left;margin-left:0!important;position:relative;"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;关注二维码：</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-block cy-uploadpic-ctn" id="followQr" style=" float:left;margin-left:0!important;position:relative;"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;链接路径：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="url" value="${websiteConfiguration.url}" lay-verify="required" placeholder="请输入链接路径" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;状态：</label>
                        <div class="layui-input-inline">
                            <select name="status" id="status" lay-verify="required" ></select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;公司地址：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="companyAddress" value="${websiteConfiguration.companyAddress}" lay-verify="required" placeholder="请输入公司地址" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;邮箱：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="mailbox" value="${websiteConfiguration.mailbox}" lay-verify="required" placeholder="请输入邮箱" autocomplete="off" class="layui-input" maxlength="100">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;网站备案号：</label>
                        <div class="layui-input-inline w440">
                            <input type="text" name="recordNo" value="${websiteConfiguration.recordNo}" lay-verify="required" placeholder="请输入网站备案号" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;经度：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="longitude" value="${websiteConfiguration.longitude}" lay-verify="required" placeholder="请输入经度" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;纬度：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="latitude" value="${websiteConfiguration.latitude}" lay-verify="required" placeholder="请输入纬度" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;描述：</label>
                        <div class="layui-input-inline w440">
                            <textarea style="border:#e6e6e6 1px solid !important;padding-left: 10px !important;" class="layui-textarea" name="description"
                                      autocomplete="off" placeholder="请输入描述" maxlength="2000">${websiteConfiguration.description}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;关于我们：</label>
                        <div class="layui-input-inline w440">
                            <textarea style="border:#e6e6e6 1px solid !important;padding-left: 10px !important;" class="layui-textarea" id="aboutUs" name="aboutUs" lay-verify="content"
                                      autocomplete="off" placeholder="请输入描述" maxlength="2000">${websiteConfiguration.aboutUs}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">&nbsp;优化键：</label>
                        <div class="layui-input-inline w440">
                            <textarea style="border:#e6e6e6 1px solid !important;padding-left: 10px !important;" class="layui-textarea" name="seoKeywords"
                                      autocomplete="off" placeholder="优化键" maxlength="2000">${websiteConfiguration.seoKeywords}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">&nbsp;网站优化描述：</label>
                        <div class="layui-input-inline w440">
                            <textarea style="border:#e6e6e6 1px solid !important;padding-left: 10px !important;" class="layui-textarea" name="seoDescription"
                                      autocomplete="off" placeholder="网站优化描述" maxlength="2000">${websiteConfiguration.seoDescription}</textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block" style="margin-left: 0px !important;text-align: center">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="submitBtn">提交</button>
                <button type="button" id="cancel" class="layui-btn layui-btn-primary">取消</button>
                <button type="button" style="display: none;" id="save" class="layui-btn layui-btn-primary"></button>
            </div>
        </div>
    </form>
</div>
<script src="${s.base}/lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/js/common.js" type="text/javascript" charset="utf-8"></script>
<script>
    layui.use(['jquery', 'form', 'page', 'fileUtil', 'baseutil'], function () {
        var $ = layui.jquery,
            form = layui.form,
            page = layui.page,
            fileUtil = layui.fileUtil,
            baseutil = layui.baseutil;

        fileUtil.uploadImage('logo', "work/site/mult", '${websiteConfiguration.logo}');
        fileUtil.uploadImage('interactQr', "work/site/mult", '${websiteConfiguration.interactQr}');
        fileUtil.uploadImage('followQr', "work/site/mult", '${websiteConfiguration.followQr}');

        //初始化富文本
        var index = baseutil.layeditKnifezBuild("aboutUs", 300);

        page.initDict('base_status', function (dictData) {
            page.showDict($("#status"), page.aceeptDictContentList(dictData, 'base_status'), "请选择", '${websiteConfiguration.status}');
        });

        //监听提交
        form.on('submit(submitBtn)', function (data) {
            data.field.id = '${websiteConfiguration.id}';
            data.field.aboutUs = baseutil.layeditBuildContent(index);
            baseutil.post("/website/websiteconfiguration/addOrUpdate", data.field, function () {
                $("#save").click();
            });
            return false;
        });
    });
</script>
</body>
</html>